import torch
from torch.nn import Parameter
from torch.nn.init import xavier_normal_


def get_param(shape):
    """
    功能：以shape创建并初始化可训练参数类；
    调用：
    self.w_loop		= get_param((in_channels, out_channels))
    """
    param = Parameter(torch.Tensor(*shape));
    xavier_normal_(param.data)
    return param